package net.aetherial.context.grounding.gatherers;

import java.util.*;

/**
 * A dummy gatherer used for testing the system. It sends nonsense turns to the system with a random score.
 */

public class DummyGatherer extends Gatherer
{
	public void run () 
	{
		String question = "Iis igitur est difficilius satis facere, qui se Latina scripta dicunt contemnere";
		String answer = "Synephebos ego, inquit, potius Caecilii aut Andriam Terentii quam utramque Menandri legam?";
		
		Random r = new Random ();
		
		String next = question;

		try 
		{
			while (true)
			{
				double rand = r.nextDouble ();

				Thread.sleep ((long) (1000 * 60 * rand));

				analyzer.process ("foo", next, 0.0);

				if (next == answer)
					next = question;
				else
					next = answer;
			}
		} 
		catch (InterruptedException e) 
		{
			e.printStackTrace();
		}
	}
}
